package controller

import "github.com/kataras/iris/v12/mvc"

// 请求方法+路由名遵循大驼峰命名规范!

// ExampleController serves the "/", "/ping" and "/hello".
type ExampleController struct {}

// Get serves
// Method:   GET
// Resource: http://localhost:8080/example
func (c *ExampleController) Get() mvc.Result {
	return mvc.Response{
		ContentType: "text/html",
		Text:        "<h1>Welcome</h1>",
	}
}

// GetPing serves
// Method:   GET
// Resource: http://localhost:8080/example/ping
func (c *ExampleController) GetPing() string {
	return "pong"
}

// GetHello serves
// Method:   GET
// Resource: http://localhost:8080/example/hello
func (c *ExampleController) GetHello() interface{} {

	return map[string]string{"message": "Hello Iris!"}
}
